package cn.usts.edu.lesson01;

import java.net.InetSocketAddress;

public class TestSocketAddress {
    public static void main(String[] args) {
        InetSocketAddress socketAddress = new InetSocketAddress("127.0.0.1", 8080);
        System.out.println(socketAddress);
        System.out.println(socketAddress.getAddress());// 地址
        System.out.println(socketAddress.getPort());    // 端口
        System.out.println(socketAddress.getHostName());  // 域名//C:\Windows\System32\drivers\etc\hosts文件中
    }
}
